package qj.pooling;

/**
 * This abstract pool provide a simple implementation of pooling technique.<br/>
 * When acquire method called, an available object is returned, that object
 * will be marked locked by the pool, and can not be acquired by other processes
 * until release method is called on that object again.<br/>
 * <br/>
 * If the pool has max size, acquire will return null.<br/>
 * <br/>
 * The pool need a manager, or else it will throw NullPointerException.<br/>
 * <br/>
 * Be careful of acquire no release error.<br/>
 * <br/>
 * USAGE:<br/>
 * 	class ServantThreadPool extends SimpleObjectPool implements PoolManagable {<br/>
 * 		public ServantThreadPool() {<br/>
 *      	this.setPoolManager(this);<br/>
 *      }<br/>
 * 	}<br/>
 * <br/>
 * Created by QuanLA<br/>
 * Date: Apr 6, 2006<br/>
 * Time: 2:41:09 PM<br/>
 */
public interface ObjectPool {
    public Object acquire();
    public void release(Object obj);
    public int size();
}
